package com.cdwl.tiyanke_java.controller;

import com.cdwl.tiyanke_java.service.UserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@RestController
public class UserController {

    @Resource
    private UserService userService;

    @RequestMapping("/selectAll")
    public Map<String, Object> selectAll() {
        return userService.selectAll();
    }

    @RequestMapping("/login")
    public Map<String, Object> login(@RequestParam String username,
                                     @RequestParam String password) {
        return userService.login(username, password);
    }
}
